﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Rippoll.Master" CodeBehind="RegisterUser.aspx.cs" Inherits="RipPoll.Web.RegisterUser" %>

<asp:Content ContentPlaceHolderID="rippollMainBody" runat="server">
        <script type="text/javascript">
            var choiceCount = 0;
            var rootId = "rippollMainBody_"

            $(document).ready(function () {
                $('#' + rootId + 'btnCreateUser').click(function () {

                    if ($('#' + rootId + 'txtFirstName ').val() == "") {
                        alert("Enter First Name");
                        $('#' + rootId + 'txtFirstName').focus();
                        return false;
                    }

                    if ($('#' + rootId + 'txtLastName').val() == "") {
                        alert("Enter Last Name");
                        $('#' + rootId + 'txtLastName').focus();
                        return false;
                    }


                    if ($('#' + rootId + 'txtPassword').val() == "") {
                        alert("Enter password");
                        $('#' + rootId + 'txtPassword').focus();
                        return false;
                    }

                    if ($('#' + rootId + 'txtConfirmPassword').val() == "") {
                        alert("Enter confirm password");
                        $('#' + rootId + 'txtConfirmPassword').focus();
                        return false;
                    }

                    if ($('#' + rootId + 'txtCity').val() == "") {
                        alert("Enter City");
                        $('#' + rootId + 'txtCity').focus();
                        return false;
                    }

                    if ($('#' + rootId + 'txtEmail').val() == "") {
                        alert("Enter Email");
                        $('#' + rootId + 'txtEmail').focus();
                        return false;
                    }

                });


                $('#' + rootId + 'txtFirstName').focusout(function () {
                    if ($('#' + rootId + 'txtFirstName').val() == "") {
                        alert("Enter First Name");
                        $('#' + rootId + 'txtFirstName').focus();
                    }
                });


                $('#' + rootId + 'txtLastName').focusout(function () {
                    if ($('#' + rootId + 'txtLastName').val() == "") {
                        alert("Enter Last Name");
                        $('#' + rootId + 'txtLastName').focus();
                    }
                });


                $('#' + rootId + 'txtPassword').focusout(function () {
                    if ($('#' + rootId + 'txtPassword').val() == "") {
                        alert("Enter password");
                        $('#' + rootId + 'txtPassword').focus();
                    }
                });



                $('#' + rootId + 'txtConfirmPassword').focusout(function () {
                    if ($('#' + rootId + 'txtConfirmPassword').val() == "") {
                        alert("Enter confirm password");
                        $('#' + rootId + 'txtConfirmPassword').focus();
                    }
                });

                $('#' + rootId + 'txtCity').focusout(function () {
                    if ($('#' + rootId + 'txtCity').val() == "") {
                        alert("Enter City");
                        $('#' + rootId + 'txtCity').focus();
                    }
                });

                $('#' + rootId + 'txtEmail').focusout(function () {
                    if ($('#' + rootId + 'txtEmail').val() == "") {
                        alert("Enter Email");
                        $('#' + rootId + 'txtEmail').focus();
                    }
                });


            });


        </script>
        <br /> <br /><br /> 
        <table id='maintable' style="margin-left:15px">
            <tr>
                <td>
                    <asp:Label ID='lblFirstName' Text='First Name:' runat="server" CssClass="smallTextWhite"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID='txtFirstName' Text='' runat="server" CssClass="smallText"></asp:TextBox>    
                </td>            
            </tr>    
            <tr>
                <td>
                    <asp:Label ID='lblLastName' Text='Last Name:' runat="server" CssClass="smallTextWhite"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID='txtLastName' Text='' runat="server" CssClass="smallText"></asp:TextBox>    
                </td>            
            </tr>    
            <tr>
                <td>
                    <asp:Label ID='lblYearofBirth' Text='Year of Birth:' runat="server" CssClass="smallTextWhite"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="ddlYearOfBirth" runat="server" CssClass="smallText"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID='lblPassword' Text='Password:' runat="server" CssClass="smallTextWhite"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID='txtPassword' Text='' TextMode="Password" runat="server" CssClass="smallText"></asp:TextBox>    
                </td>            
            </tr>    
            <tr>
                <td>
                    <asp:Label ID='lblConfirmPassword' Text='Confirm Password:' runat="server" CssClass="smallTextWhite"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID='txtConfirmPassword' Text='' TextMode="Password" runat="server" CssClass="smallText"></asp:TextBox>    
                </td>            
            </tr>
            <tr>
                <td>
                    <asp:Label ID='lblCity' Text='City:' runat="server" CssClass="smallTextWhite"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID='txtCity' Text='' runat="server" CssClass="smallText"></asp:TextBox>    
                </td>            
            </tr>    
            <tr>
                <td>
                    <asp:Label ID='lblEmail' Text='Email:' runat="server" CssClass="smallTextWhite"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID='txtEmail' Text='' runat="server" CssClass="smallText"></asp:TextBox>    
                </td>            
            </tr>    
            <tr><td><asp:Label Text="My Interestes are:" runat="server" CssClass="smallTextWhite"></asp:Label></td>
                <td>
                        <asp:CheckBoxList id="PollInterests" runat="server" RepeatDirection="Horizontal" CssClass="smallText"></asp:CheckBoxList>                
                </td>
            </tr>    
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button Text="Register Me" ID="btnCreateUser" runat="server" 
                        onclick="btnCreateUser_Click" CssClass="smallTextWhite" />
                </td>
            </tr>
        </table>
    <br /> <br /><br /> 
    <input type="hidden" runat="server" id="totalpollinterestcount" />
    </asp:Content> 
    